var htmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');



module.exports = {
    // configuration
   context: __dirname,
   entry: './src/app.js',
   output: {
        path: __dirname + "/dist",
        filename: "js/[name].bundle.js"
   },
   module: {
        loaders: [
            { test: /\.js$/, 
              loader: "babel-loader",
              exclude:[
                path.resolve(__dirname,'node_modules/'),
                path.resolve(__dirname,'dist/')
              ],
              include:[
                path.resolve(__dirname,'src/')
              ],
              query:{
                presets:['latest']
              }
            }
        ]
    },
   plugins:[

   		new htmlWebpackPlugin({
        filename:'index.html',
   			template:'index.html',
        inject:'body'
   		})
   ]
};